<?php
class Login_Model_Loginaction implements Login_Model_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_tokencheckout;  
    private $login_data_usercheckout;
    
    public function main(array $variables = null){
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_notnull->main($variables);
        //var_dump($variables);
        //die();
        //$this->core_controller_tokencheckout = new Core_Controller_Tokencheckout;
        //$this->core_controller_tokencheckout->main($variables['post']);
        //var_dump($variables);
        //die();
        $this->login_data_usercheckout = new Login_Data_Usercheckout;
        $this->login_data_usercheckout->main($variables);
        if(isset($_SESSION['username']) && isset($_SESSION['access_level'])){
            header("Location: ".SITE_ROOT."zarzadzaj-strona.html");
        }
        else {
            header("Location: ".SITE_ROOT."login.html");
        }
    }
}
